#include <iostream>
using namespace std;
using ll=long long;
int main() {

	int t;
	cin>>t;
	while(t--){
		ll n,a,b;
		cin>>n>>a>>b;
		ll nRet;
		if(3*a<=2*b){
			nRet=(n+1)/2*a;
			nRet=min(nRet,(n-3+1)/2*a+b);
		}
		else{
			nRet=(n+2)/3*b;
			nRet=min(nRet,(n-2+2)/3*b+a);
			nRet=min(nRet,(n-4+2)/3*b+2*a);
		}
		cout<<nRet<<endl;
	}
}
